package com.jd.service;


import com.jd.dao.CreateBatFilesDAO;
import com.jd.po.BatFile;
import com.jd.po.User;
import com.jd.tools.BatFileReader;



public class CreateBatFilesServiceImpl implements CreateBatFilesService {
	private CreateBatFilesDAO createBatFilesDAO;
	public void setCreateBatFilesDAO(CreateBatFilesDAO createBatFilesDAO) {
		this.createBatFilesDAO = createBatFilesDAO;
	}

	public CreateBatFilesDAO getCreateBatFilesDAO() {
		return createBatFilesDAO;
	}

	@Override
	public void createBat(BatFile bf, User user) throws Exception {
		//String svnUrl = "http://11.213.121";
		String svnUrl = createBatFilesDAO.querySvnUrlByUserGroup((bf.getProjectName().split("-"))[0], (bf.getProjectName().split("-"))[1]);
		BatFileReader.createBatFile(bf, user.getUserGroup(), svnUrl);
	}


}
